package org.example.core.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

@Configuration
@ConfigurationProperties(prefix = "common")
public class CommonConfiguration {

    private Security security = new Security();

    public static class Security {
        private List<String> anonUrls = new LinkedList<>();

        /**
         * 匿名访问
         * @return
         */
        public List<String> getAnonUrls() {
            return anonUrls;
        }

        public void setAnonUrls(List<String> anonUrls) {
            this.anonUrls = anonUrls;
        }

        /**
         * 需要权限
         */
        private List<String> authUrls = new LinkedList<>();

        public List<String> getAuthUrls() {
            return authUrls;
        }

        public void setAuthUrls(List<String> authUrls) {
            this.authUrls = authUrls;
        }
    }

    public Security getSecurity() {
        return security;
    }

    public void setSecurity(Security security) {
        this.security = security;
    }
}
